/**
 * @description 获取当前 safeAreaInsets
 */
export default function useSafeArea() {
  const safeAreaInsets = ref<UniApp.SafeAreaInsets | null | undefined>(null)

  onMounted(() => {
    safeAreaInsets.value = uni.getSystemInfoSync().statusBarHeight
      ? uni.getSystemInfoSync().safeAreaInsets
      : null
  })

  return safeAreaInsets
}
